home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 May: Tool Chest / Developer CD Series May 1996 (Tool Chest) (Apple Computer) (1996).iso / Tool Chest / Interfaces & Libraries / Interfaces / PInterfaces / IntEnv.p < prev    next >
Encoding:
Text File  |  1995-08-05  |  3.3 KB  |  165 lines  |  [TEXT/MPS ]

  1. {
  2. Created: Wednesday, June 27, 1990 at 6:42 PM
  3.     IntEnv.p
  4.     Pascal Interface to the Macintosh Libraries
  5.  
  6.         Copyright Apple Computer, Inc. 1989-1995
  7.         All rights reserved
  8. }
  9.  
  10.  
  11. {$IFC UNDEFINED UsingIncludes}
  12. {$SETC UsingIncludes := 0}
  13. {$ENDC}
  14.  
  15. {$IFC NOT UsingIncludes}
  16.     UNIT IntEnv;
  17.     INTERFACE
  18. {$ENDC}
  19.  
  20. {$IFC UNDEFINED UsingIntEnv AND UNDEFINED __INTENV__}
  21. {$SETC UsingIntEnv := 1}
  22. {$SETC __INTENV__ := 1}
  23.  
  24. {$I+}
  25. {$SETC IntEnvIncludes := UsingIncludes}
  26. {$SETC UsingIncludes := 1}
  27. {$IFC UNDEFINED UsingPasLibIntf}
  28. {$I $$Shell(PInterfaces)PasLibIntf.p}
  29. {$ENDC}
  30.  
  31. {$IFC UNDEFINED __CONDITIONALMACROS__}
  32. {$I ConditionalMacros.p}
  33. {$ENDC}
  34.  
  35. {$SETC UsingIncludes := IntEnvIncludes}
  36.  
  37. {$ALIGN MAC68K}
  38.  
  39.     CONST
  40.  
  41.       { CMD words for IEfaccess(), from <fcntl.h> }
  42.       { IEfaccess command words for general usage in any program: }
  43.       
  44.       F_OPEN = $6400; { (('d'<<8)|00), d => "directory" ops }
  45.       F_DELETE = $6401;
  46.       F_RENAME = $6402;
  47.  
  48.       { IEfaccess command words for use only in MPW Tools: }
  49.       
  50.       F_GTABINFO = $6500; { (('e'<<8)|00), e => "editor" ops }
  51.       F_STABINFO = $6501;
  52.       F_GFONTINFO = $6502;
  53.       F_SFONTINFO = $6503;
  54.       F_GPRINTREC = $6504;
  55.       F_SPRINTREC = $6505;
  56.       F_GSELINFO = $6506;
  57.       F_SSELINFO = $6507;
  58.       F_GWININFO = $6508;
  59.       F_SWININFO = $6509;
  60.       F_GSCROLLINFO = $650A;
  61.       F_SSCROLLINFO = $650B;
  62.       F_GMARKER = $650D;
  63.       F_SMARKER = $650C;
  64.       F_GSAVEONCLOSE = $650F;
  65.       F_SSAVEONCLOSE = $650E;
  66.  
  67.       { Open modes for IEopen(), from <fcntl.h> }
  68.  
  69.       O_RDONLY = $0000;
  70.       O_WRONLY = $0001;
  71.       O_RDWR = $0002;
  72.       O_APPEND = $0008;
  73.       O_RSRC = $0010;
  74.       O_ALIAS = $0020;
  75.       O_CREAT = $0100;
  76.       O_TRUNC = $0200;
  77.       O_EXCL = $0400;
  78.       O_NRESOLVE = $4000;
  79.  
  80.       { IOCtl parameters }
  81.  
  82.       FIOINTERACTIVE = $6602; { (('f'<<8)|02), f => "open file" ops }
  83.       FIOBUFSIZE = $6603;
  84.       FIOFNAME = $6604;
  85.       FIOREFNUM = $6605;
  86.       FIOSETEOF = $6606;
  87.  
  88.     TYPE
  89.       IEString = STRING;
  90.       IEStringPtr = ^IEString;
  91.       IEStringVec = ARRAY [0..8191] OF IEStringPtr;
  92.       IEStringVecPtr = ^IEStringVec;
  93.       
  94.       { RECORD types used by IEfaccess: }
  95.       
  96.       SelectionRecord = RECORD
  97.           startingPos:    LONGINT;
  98.         endingPos:        LONGINT;
  99.         displayTop:        LONGINT;
  100.       END;
  101.       
  102.       MarkElement = RECORD
  103.           markStart:        LONGINT;
  104.         markEnd:        LONGINT;
  105.         charCount:        CHAR;
  106.         name:            PACKED ARRAY [0..65] OF CHAR;    { NOTE:  This is a C string! }
  107.       END;
  108.  
  109.     {$PUSH}
  110.     {$J+} { EXPORTed unit globals }
  111.  
  112.     VAR
  113. {$IFC UNDEFINED __CFM68K__}
  114.     {$LibExport+}
  115. {$ENDC}
  116.  
  117.       ArgC: LONGINT;
  118.       ArgV: IEStringVecPtr;
  119.       _EnvP: IEStringVecPtr;
  120.  
  121.       Diagnostic: TEXT;
  122.     {$POP}
  123.  
  124. { The following definition has been moved to MacRuntime.p }
  125. {    FUNCTION IEStandAlone: BOOLEAN; }
  126.  
  127.     FUNCTION IEgetenv(envName: STRING; VAR envValue: UNIV IEString): BOOLEAN;
  128.  
  129.     FUNCTION IEfaccess(fName: STRING; opCode: LONGINT;
  130.                        arg: UNIV LONGINT): LONGINT;
  131.  
  132.     PROCEDURE IEopen(VAR fvar: UNIV PASCALFILE; fName: STRING; mode: LONGINT);
  133.  
  134.     FUNCTION IEioctl(VAR fvar: UNIV PASCALFILE; request: LONGINT;
  135.                      arg: UNIV LONGINT): LONGINT;
  136.  
  137.     FUNCTION IElseek(VAR fvar: UNIV PASCALFILE; offset: LONGINT;
  138.                      whence: LONGINT): LONGINT;
  139.  
  140. {$IFC UNDEFINED __CFM68K__}
  141.     {$PUSH}
  142.     {$LibExport+}
  143. {$ENDC}
  144.  
  145.     PROCEDURE IEatexit(exitProc: UNIV LONGINT);
  146.       C;
  147.  
  148.     PROCEDURE IEexit(status: LONGINT);
  149.       C;
  150.  
  151.     PROCEDURE IE_exit(status: LONGINT);
  152.       C;
  153.  
  154. {$ALIGN RESET}
  155. {$IFC UNDEFINED __CFM68K__}
  156.     {$POP}
  157. {$ENDC}
  158.  
  159. {$ENDC}    { UsingIntEnv }
  160.  
  161. {$IFC NOT UsingIncludes}
  162.     END.
  163. {$ENDC}
  164.  
  165.